package com.abel.demo.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import java.util.ArrayList;
import java.util.List;

import com.abel.demo.model.AddressModel;

/**
* @author abel.lin
* @date_time 2018-07-12 14:26
* @description
*/
public class AddressDomain extends AddressModel {

    public static AddressDomain genDomain(AddressModel model){
        if(model == null){
            model = new AddressModel();
        }
        AddressDomain domain = JSON.parseObject(JSON.toJSONString(model), AddressDomain.class);
        return domain;
    }

    public static List<AddressDomain> genDomainList(List<AddressModel> modelList){
        if(modelList == null){
            modelList = new ArrayList<AddressModel>();
        }
        List<AddressDomain> domainList = JSONArray.parseArray(JSONArray.toJSONString(modelList), AddressDomain.class);
        return domainList;
    }

}
